package com.atguigu.lease.common.login;

/**
 * @author cxt
 * &#064;Description 自定义线程变量(将用户登入信息传入其中)
 * &#064;create 2025/3/20 下午4:17
 */
public class LoginUserHolder {
    public static ThreadLocal<LoginUser> threadLocal = new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser) {
        threadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser() {
        return threadLocal.get();
    }

    public static void clear() {
        threadLocal.remove();
    }
}